import request from '@/utils/request.ts'
import { ResponseType, RssDownloadInfoType } from '@/type/typedefine.ts'

export function getRssDownloadInfos(
  animeId: bigint,
): Promise<ResponseType<RssDownloadInfoType[]>> {
  return request({
    url: '/download/info/' + animeId.toString(),
    method: 'get',
  })
}

export function pauseDownloadTask(hash: string): Promise<ResponseType<string>> {
  return request({
    url: '/download/pause',
    method: 'post',
    params: {
      hash: hash,
    },
  })
}

export function resumeDownloadTask(
  hash: string,
): Promise<ResponseType<string>> {
  return request({
    url: '/download/resume',
    method: 'post',
    params: {
      hash: hash,
    },
  })
}
